/*
 *  *  This file is part of Spidex.
 *  
 *  Spidex is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *  
 *  Spidex is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *  
 *  You should have received a copy of the GNU General Public License
 *  along with Spidex.  If not, see <http://www.gnu.org/licenses/>.
 * This Package is simple GUI window which displays information written through
 * java.util.logging.Logger
 */

package WindowLogger;

/**
 *
 * @author xatrix
 */
public class WindowLoggerDialog extends javax.swing.JDialog {
    private java.awt.TextArea debugText;
    private javax.swing.GroupLayout loggerDialogLayout;
    
    /** 
     * Creates a new instance of Jframe a JDialog
     */
    public WindowLoggerDialog() {
        super();
        this.debugText = new java.awt.TextArea();
        super.setTitle("Debug message");
        super.setMinimumSize(new java.awt.Dimension(440, 270));
        super.getAccessibleContext().setAccessibleParent(null);
        this.debugText.setEditable(false);
        loggerDialogLayout = new javax.swing.GroupLayout(super.getContentPane());
        super.getContentPane().setLayout(loggerDialogLayout);
        
        loggerDialogLayout.setHorizontalGroup(
            loggerDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(debugText, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );
        loggerDialogLayout.setVerticalGroup(
            loggerDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(debugText, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );
        loggerDialogLayout.setHorizontalGroup(
            loggerDialogLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(debugText, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
        );
        super.setVisible(false);
    }

    /**
     * Function display message to JText
     * 
     * @param message String which will be displayed in JDialog
     */
    void showMessage(String message) {
        debugText.append(message);
    }
    
}